<f:if condition="{configuration.insertAbove}">
	<f:render section="paginator" arguments="{pagination: pagination, configuration: configuration}" />
</f:if>

<f:renderChildren arguments="{contentArguments}" />

<f:if condition="{configuration.insertBelow}">
	<f:render section="paginator" arguments="{pagination: pagination, configuration: configuration}" />
</f:if>

<f:section name="paginator">
	<div id="page-nav">
		<f:for each="{pagination.pages}" as="page">
			<f:if condition="{page.isCurrent}">
				<f:then>
					<span class="current">
						{page.number}
					</span>
				</f:then>
				<f:else>
					<span>
						<f:if condition="{page.number} > 1">
							<f:then>
								<f:widget.link arguments="{currentPage: page.number}" addQueryStringMethod="{configuration.addQueryStringMethod}">{page.number}</f:widget.link>
							</f:then>
							<f:else>
								<f:widget.link addQueryStringMethod="{configuration.addQueryStringMethod}">{page.number}</f:widget.link>
							</f:else>
						</f:if>
					</span>
				</f:else>
			</f:if>
		</f:for>
	</div>
</f:section>
